home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Everything For A Hacker
/
19990506-[HACK].iso
/
HEXEDIT
/
TCRASM
/
X390W32S.ZIP
/
TXA.SPF
next >
Wrap
Text File
|
1997-02-19
|
6KB
|
204 lines
/***********************************************************************
(c) Copyright 1994-1997, Tachyon Software
MACRO: TXA - Tachyon 390 Cross Assembler
PURPOSE: Edit macro for SPF/PC and Tritus SPF to assemble the
program currently being edited and display any errors
that are found.
SIDE If error messages are found, sets Alt-F5 key to
EFFECT: LOCATE SPECIAL so that the user can use that key
to jump between all the error messages found by the
compiler. Will not modify the key setting If it has
been changed from its default.
ISPEXEC SHORT and LONG messages are modified to reflect
the outcome of the compile.
NOTE: You must change the first statement below (X390PATH=...)
to reflect the path of the Tachyon 390 Cross Assembler.
CHANGES: Mar 30, 1996 - Improved by Jared Thomas of BMC Software
to split the note lines at 72 characters.
May 25, 1996 - Changed SYSLIB to use new variable syntax.
Sep 3, 1996 - Updated to support Tritus SPF
Nov 30, 1996 - Updated to support SPF/Professional
Feb 19, 1997 - Removed obsolete -ND option for release 1.2
***********************************************************************/
/* Change the following statement to be the path containing
the Tachyon 390 Cross Assembler program files. */
X390PATH = "C:\X390\"
/* If you are running the Windows version and want to use
the GUI instead of the command-line assembler, change
the following statement to: X390WIN = 1 */
X390WIN = 0
/* Change the following statement as needed for your environment. */
SYSLIB = '"-SL&D*.MAC;&S"'
/* The following statement sets the default parameters. */
DEFPARMS = "-NL -NO"
trace off
'ISREDIT MACRO(PARMS)'
If PARMS = "" Then PARMS = DEFPARMS
/* Get rid of previous error lines */
'ISREDIT RESET SPECIAL'
/* If source has not been saved, save it */
'ISREDIT (modified) = DATA_CHANGED'
If (modified=YES) Then
'ISREDIT SAVE'
/* Retrieve filename information about source file
and bild the command line to invoke the assembler. */
outFile = "TXATERM.OUT"
errFile = "TXAERROR.OUT"
ZEDFQNM = ''
'ISPEXEC VGET ZEDFQNM'
If length(ZEDFQNM) == 0 Then Do
'ISREDIT (DATASET) = DATASET'
filename = TRANSLATE(dataset)
filename = FILESPEC("Name",filename)
'ISPEXEC VGET ZVERSION'
PARSE VAR ZVERSION spfver '.' spfrel '.' spfmod
If X390WIN <> 0 Then
X390CMD = X390PATH"X390WIN.EXE" PARMS SYSLIB filename "-TERM("outFile")"
Else Do
X390CMD = X390PATH"X390.EXE" PARMS SYSLIB filename "1>"outFile "2>"errFile
If spfver >= 5 Then
X390CMD = value("COMSPEC",,"CMD") '/C"'X390CMD'"'
End
End
Else Do
spfver = 0 /* 0 = Tritus SPF */
filename = ZEDFQNM
X390CMD = X390PATH"X390.EXE" PARMS SYSLIB filename "1>"outFile "2>"errFile
End
/* Invoke the assembler */
Address 'CMD' X390CMD
compileRc = RC
found_one = 0
messages = 0
x = STREAM(errFile,'C','OPEN READ')
If left(x,5) = 'READY' Then Do
Do While lines(errFile) <> 0
dataline = linein(errFile)
Call top_msg dataline
found_one = 1
End
x = STREAM(errFile,'C','CLOSE')
Address 'CMD' 'DEL' errFile
End
prev_lineno = 0
x = STREAM(outFile,'C','OPEN READ')
If left(x,5) = 'READY' Then Do
Do While lines(outFile) <> 0
dataline = linein(outFile)
parse var dataline errFn ' : ' macFn ' : ' msg
If msg = '' | words(macFn) <> 1 Then Do
Parse var dataline errFn ' : ' msg
macFn = ''
End
Else Do
p = lastpos('\','\'macFn)
macFn = substr(macFn,p)' '
End
Parse var errFn errFn'('lineno')' .
If (length(lineno) = 0) | (errFn <> filename) Then Do
Call top_msg dataline
End
Else Do
If lineno > prev_lineno Then Call dump_msg prev_lineno
prev_lineno = lineno
Call add_msg macFn||msg
End
found_one = 1
messages = messages + 1
End
x = STREAM(outFile,'C','CLOSE')
Address 'CMD' 'DEL' outFile
End
Call dump_msg prev_lineno
/* If ALT-F5 is still set to RFIND, Then change it to LOCATE SPEC */
'ISPEXEC VGET ZPF41'
If (ZPF41=RFIND) Then Do
ZPF41 = "LOCATE SPECIAL"
'ISPEXEC VPUT ZPF41'
End
If found_one Then Do
'ISREDIT LOCATE FIRST SPECIAL'
'ISREDIT UP 1'
End
If spfver >= 5 Then Do
If messages == 0 Then
ZEDSMSG = "No messages"
Else If messages == 1 Then
ZEDSMSG = "1 message"
Else ZEDSMSG = messages "messages"
ZEDLMSG = ZEDSMSG "produced by the assembler."
End
Else Do
ZEDSMSG = "X390 RC =" compileRc
ZEDLMSG = "Tachyon 390 Cross Assembler return code =" compileRc
End
'ISPEXEC SETMSG MSG(ISRZ000)'
Exit
add_msg: Procedure Expose msg. m
Parse Arg text
Trace off
Do While text <> ''
If length(text) <= 72 Then p = length(text)+1
Else p = lastpos(' ',text,72)
If p <= 1 Then p = 72+1
m=m+1; msg.m = left(text,p-1)
text = ' 'strip(substr(text,p),'Leading')
End /* text not empty */
Return
dump_msg: Procedure Expose msg. m spfver
Parse Arg lineno
Trace off
If lineno > 0 Then Do i = m To 1 By -1
msg = msg.i
If spfver > 0 Then Address ISREDIT "LINE_AFTER "lineno" = MSGLINE (MSG)"
Else Address ISREDIT "LINE_AFTER "lineno" = DIAGLINE 0 (MSG)"
End i
m=0; Drop msg.; msg.=''
Return
top_msg: Procedure
Parse Arg text
Trace off
m=0; drop msg.; msg.=''
Do While text <> ''
If length(text) <= 72 Then p = length(text)+1
Else p = lastpos(' ',text,72)
If p <= 1 Then p = 72+1
msg = left(text,p-1)
Address ISREDIT "LINE_BEFORE .ZFIRST = NOTELINE (MSG)"
text = ' 'strip(substr(text,p),'Leading')
End /* text not empty */
Return